package ui;

import java.awt.Dimension;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.util.ArrayList;

import javax.imageio.ImageIO;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.UIManager;
import javax.swing.table.DefaultTableModel;

import util.ImagePanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;

public class HelpUI implements ActionListener
	{
		private static HelpUI instance = null;
		
		private JFrame frameHelpUI;
		
		private ImagePanel content;
		private Image image = null;
		
		private JTable chapters;
		private DefaultTableModel chaptersModel;
		private JScrollPane chapterScroll;
		
		private ImagePanel helpContent;
		private JScrollPane helpScroll;
		
		private JLabel helpLabel;
		
		private JButton statistics;
		private JButton backButton;
		
		private ArrayList<String> chapterList;
		
		private backButton back;
		
	public void display()
		{
			frameHelpUI.setSize(700,400);
			frameHelpUI.setVisible(true);
			frameHelpUI.setResizable(false);
			frameHelpUI.setLocationRelativeTo(null);
		}
	public HelpUI()
	{
		frameHelpUI = new MainWindow();
		
		back = new backButton();
		back.setNumber("14");
		
		statistics = new JButton();
		statistics.setOpaque(false);
		statistics.setText("Statistics");
		statistics.addActionListener(this);
		
		backButton = new JButton();
		backButton.setText("Back");
		backButton.setOpaque(false);
		backButton.addActionListener(this);
		
		try
			{
				image = ImageIO.read(new File("img/background/background.jpg"));
			}
		catch(Exception e)
			{
				msgError(null, "Could not load background");
			}
		
		
		
		chapterList = new ArrayList<String>();
		
		chapterList.add("Main");
		chapterList.add("Requests");
		chapterList.add("Offers");
		chapterList.add("Projects");
		chapterList.add("Materials");
		chapterList.add("Countries");
		chapterList.add("Cities");
		chapterList.add("Employees");
		chapterList.add("Customers");
		chapterList.add("Suppliers");
		chapterList.add("SubContractor");
		chapterList.add("Statistics");
		
		String chapterColumn[] = {"Subject"};
		
		chaptersModel = new DefaultTableModel(null, chapterColumn);
		
		chapters = new JTable(chaptersModel)
			{
				private static final long serialVersionUID = 1L;
				
				public boolean isCellEditable(int rowIndex, int colIndex)
					{
						return false;
					}
				
				public Class<?> getColumnClass(int column)
				{
					return getValueAt(0, column).getClass();
				}
			};
			
			Dimension dimension = chapters.getPreferredSize();
			double width = dimension.width / chapterColumn.length;
			double[] width_2 = { 1.0};
			
			for(int i = 0; i < chapterColumn.length; i++)
				chapters.getColumnModel().getColumn(i).setPreferredWidth((int) (width*width_2[i])); 

			chapters.setAutoCreateRowSorter(true);

			chapters.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
			chapters.addMouseListener(new MouseListener()
			{

				@Override
				public void mouseClicked(MouseEvent arg0)
					{
						modifyHelpContent();
						
					}

				@Override
				public void mouseEntered(MouseEvent arg0)
					{
						// TODO Auto-generated method stub
						
					}

				@Override
				public void mouseExited(MouseEvent arg0)
					{
						// TODO Auto-generated method stub
						
					}

				@Override
				public void mousePressed(MouseEvent arg0)
					{
						modifyHelpContent();
						
					}

				@Override
				public void mouseReleased(MouseEvent arg0)
					{
						modifyHelpContent();
						
					}
				
			});
			chapterScroll = new JScrollPane(chapters);
								
			helpLabel = new JLabel();
			
			helpLabel.setText("<html>\r\n<body style = \" margin-bottom :318px;\">\r\n<h1>\r\nWelcome\r\n</h1>\r\n <p>\r\n&nbsp Here you can find all needed information regarding the use of every feature of the system.\r\n<br> &nbsp It is reccomended that you start reading into the request guide first as it is the most detailed one, everything \r\n<br> &nbsp else using a lot of the same features.\r\n</p>\r\n <p>\r\n<br>\r\n&nbsp All you need to do is click on any of the topics on the left list and you will be presented with the information <br> &nbsp you require.\r\n</p>\r\n <p>\r\n<br>\r\n&nbsp To leave this menu simply press on the back button, or go into the navigation menu on top and go wherever\r\n<br> &nbsp else you would wish to head to. We wish you luck and hope that our system will prove pleasing and useful to\r\n<br> &nbsp you.\r\n</p>\r\n</body>\r\n</html>");
			
			helpContent = new ImagePanel(image);
			
			helpScroll = new JScrollPane(helpContent);
			GroupLayout gl_helpContent = new GroupLayout(helpContent);
			gl_helpContent.setHorizontalGroup(
				gl_helpContent.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_helpContent.createSequentialGroup()
						.addComponent(helpLabel, GroupLayout.PREFERRED_SIZE, 540, GroupLayout.PREFERRED_SIZE)
						.addContainerGap(17, Short.MAX_VALUE))
			);
			gl_helpContent.setVerticalGroup(
				gl_helpContent.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_helpContent.createSequentialGroup()
						.addGap(1)
						.addComponent(helpLabel, GroupLayout.PREFERRED_SIZE, 572, GroupLayout.PREFERRED_SIZE)
						.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
			);
			helpContent.setLayout(gl_helpContent);
			
			
			updateSubjectList(chapterList);
			
			content = new ImagePanel(image);
			GroupLayout gl_content = new GroupLayout(content);
			gl_content.setHorizontalGroup(
				gl_content.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_content.createSequentialGroup()
						.addComponent(chapterScroll, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
						.addGap(2)
						.addComponent(helpScroll, GroupLayout.PREFERRED_SIZE, 559, GroupLayout.PREFERRED_SIZE))
			);
			gl_content.setVerticalGroup(
				gl_content.createParallelGroup(Alignment.LEADING)
					.addComponent(chapterScroll, GroupLayout.PREFERRED_SIZE, 305, GroupLayout.PREFERRED_SIZE)
					.addGroup(gl_content.createSequentialGroup()
						.addGap(3)
						.addComponent(helpScroll, GroupLayout.PREFERRED_SIZE, 300, GroupLayout.PREFERRED_SIZE))
			);
			content.setLayout(gl_content);
			GroupLayout groupLayout = new GroupLayout(frameHelpUI.getContentPane());
			groupLayout.setHorizontalGroup(
				groupLayout.createParallelGroup(Alignment.LEADING)
					.addComponent(content, GroupLayout.PREFERRED_SIZE, 694, GroupLayout.PREFERRED_SIZE)
					.addGroup(groupLayout.createSequentialGroup()
						.addGap(6)
						.addComponent(backButton, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
						.addGap(484)
						.addComponent(statistics, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE))
			);
			groupLayout.setVerticalGroup(
				groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(groupLayout.createSequentialGroup()
						.addGap(22)
						.addComponent(content, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addGap(2)
						.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
							.addComponent(backButton, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
							.addComponent(statistics, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)))
			);
			frameHelpUI.getContentPane().setLayout(groupLayout);
			
	}
	public static HelpUI getInstance()
		{
			if(instance == null)
				instance = new HelpUI();
			
			return instance;
		}
	public static void main(String[] args)
		{
			try 
				{
					UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 

					HelpUI helpUI = new HelpUI();
					helpUI.display();
				}
			catch(Exception e)
				{
					System.out.println("[ERROR] Help Menu cannot load");
					e.printStackTrace();
				}
		}
	@Override
	public void actionPerformed(ActionEvent arg0)
		{
			// TODO Auto-generated method stub
			
		}
	
	private void updateSubjectList(ArrayList<String> chapters)
		{
			for(String string : chapters)
				{
					chaptersModel.addRow(
							new Object[]
										{
												string
										}
										);
				
				}
		}
	
	private void msgError(JPanel panel, String error)
		{
			JOptionPane.showConfirmDialog(panel, error, "Error", JOptionPane.PLAIN_MESSAGE, JOptionPane.ERROR_MESSAGE);
		}
	
	private void modifyHelpContent()
		{
			if(chapters.getSelectedRow() > -1)
				{
					String chapterName = String.valueOf(chapters.getValueAt(chapters.getSelectedRow(), 0));
					
					switch (chapterName)
					{
						case "Main" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom :318px;\">\r\n<h1>\r\nWELCOME\r\n</h1>\r\n <p>\r\n&nbsp Here you can find all needed information regarding the use of every feature of the system.\r\n<br> &nbsp It is reccomended that you start reading into the request guide first as it is the most detailed one, everything \r\n<br> &nbsp else using a lot of the same features.\r\n</p>\r\n <p>\r\n<br>\r\n&nbsp All you need to do is click on any of the topics on the left list and you will be presented with the information <br> &nbsp you require.\r\n</p>\r\n <p>\r\n<br>\r\n&nbsp To leave this menu simply press on the back button, or go into the navigation menu on top and go wherever\r\n<br> &nbsp else you would wish to head to. We wish you luck and hope that our system will prove pleasing and useful to\r\n<br> &nbsp you.\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Requests" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:23px;\">\r\n<h1>\r\nREQUESTS\r\n</h1>\r\n <p>\r\n&nbsp At the beginning of any operation. they contain the basic information of a project which can either be added<br> &nbsp manually from this administration system, or from the customer system on the website.<br>\r\n&nbsp From a request, multiple offers can be made with different information, which, a customer can then accept and <br> &nbsp turn into one or more projects.<br>&nbsp The same can be done from this system through the other menus which will be explained in the other help <br> &nbsp chapters.<br><br> &nbsp When creating a new request, either you or the customer must insert the following information :\r\n<ul>\r\n<li>\r\nName - The name of the project he wants to have from the company.\r\n</li>\r\n<li>\r\nDrawing Number - The code of the project drawing which will be sent separately to the company from the customer.\r\n</li>\r\n<li>\r\nQuantity - The quantity that they want to recieve of that.\r\n</li>\r\n<li>\r\nDescription - Any details that they think important they can fill here, you can also write or edit that to your needs.\r\n</li>\r\n<li>\r\nDimensions - The information regarding the sizes of the wanted product can be inserted here.\r\n</li>\r\n<li>\r\nCustomer - When making the requests on the administration system, here you will choose for which customer the request will be made.\r\n</li>\r\n<li>\r\nDeadline - The time by which the customer wants the project done, judging by this you can decide if the project would be achievable or not.\r\n</li>\r\n</ul>\r\n&nbsp On the tab of All Requests you can clearly see all of the information from created requests.\r\n<br> &nbsp To see the description simply press the button \"Get Description\". You can even edit all of the information for \r\n<br> &nbsp any various reason by simply clicking on \"Edit Request\". By pressing that you will be shown a new menu with all\r\n<br> &nbsp of the information in an editable format. \r\n\r\n<br><br> &nbsp By clicking on the button \"Change Status\" you can easily change the status of a request, making it active or \r\n<br> &nbsp unactive. By using this feature, you can easily alternate between a currently active request or one which is\r\n <br> &nbsp unactive but which you can still see and reactivate in case the customer wishes to remake the same project. <br> &nbsp \r\nThe \"Make Offer\" button allows to make different offers for a customer adding the price for each version,\r\n <br> &nbsp based on quantity, deadline etc.\r\n<br><br> &nbsp You can also search for all requests by different keywords. You can select either everything in which case \r\n<br> &nbsp writting something which would be anywhere in any request would show them all or something in particular,\r\n<br> &nbsp like city, country, customer etc. If the information is in common with other requests, more will appear,\r\n<br> &nbsp if it is only for one, just the one will appear.\r\n\r\n<br><br> &nbsp For more information, choose \"Offers\" or \"Projects\".\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Offers" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:305px;\">\r\n<h1>\r\nOFFERS\r\n</h1>\r\n <p>\r\n&nbsp Can be created manually on this system from the \"Offers\" menu and then automatically send to the customer\r\n<br> &nbsp system where a user there can choose one and send it back with the information into a project which can then\r\n<br> &nbsp be seen in the \"Project\" menu.\r\nHowever, offers can easily be turned into project from this sytem by pressing<br> &nbsp\r\n the \"Make Project\" button, following by adding the other needed information such as the location of the project\r\n<br> &nbsp which is called \"project link\", the comments on this particular project, which can be modified later, this can be\r\n<br> &nbsp comments or ideas on the project which the customer will not see, or notes on how many materials were used &nbsp &nbsp etc.\r\n<br> &nbsp Selection of subContractors and how much each costs, after which the button \"Add\" can be pressed to add\r\n<br> &nbsp them in the list. All of the other features are similar to the requests, you can edit, change status, check the \r\n<br> &nbsp description. The search function is the same and you can also create as many offers as you wish without a\r\n<br> &nbsp request, just doing it manually from here just like the basic request menu only with the addition of a price\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Projects" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:306px;\">\r\n<h1>\r\nPROJECTS\r\n</h1>\r\n <p>\r\n&nbsp Can be created manually on this system from the \"Projects\" menu or received from the offers menu, either\r\n<br>&nbsp done on this system or from an offer accepted by a customer.  This menu is a bit different then the others.\r\n<br>&nbsp Making a project requires all usual information but in addition also the SubContractor information.\r\n<br> &nbsp To check on the information about materials and indeed to add,remove or inspect materials used on a project\r\n<br> &nbsp or add, remove or just inspect subContractors you must go to the \"Project Details\" tab.\r\n<br> &nbsp On the \"All Projects\" tab, you can see most of the information and get everything else, such as comments,\r\n<br> &nbsp description and even open a folder/or a link for the location of the project file.\r\n<br> &nbsp You can also edit the project and all of it's information.\r\n<br> &nbsp The search function is done the same as all of the other menus.\r\n\r\n<br> <br> &nbsp For more information on subContractors and materials, please visit the chapters regarding them\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Materials" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:156px;\">\r\n<h1>\r\nMATERIALS\r\n</h1>\r\n <p>\r\n&nbsp The menu for materials is completely different from any other menu. Let us start with the \"All Materials\" tab.\r\n<br> &nbsp The search function is exactly like any other menu, however, once you select an item from the list you will see\r\n<br> &nbsp more information on the right called \"Material Info\".  There you can see the name, type, price, stock, dimension\r\n<br> &nbsp and number of suppliers.\r\n<br> &nbsp You can also add more suppliers to the list or edit the ones currently supplying the material.\r\n<br> <br>\r\n&nbsp The \"New Material\" tab allows you to create a new material, with all of the information needed, including\r\n<br> &nbsp custom dimension and a type, which will keep track of how to address it's problems.\r\n<br> &nbsp On the right you can see all possible suppliers and the ones selected. clicking on any of the suppliers from the \r\n<br> &nbsp \"All Suppliers\" list makes a window to appear which asks for an amount of how much you will receive from\r\n<br> &nbsp that supplier.\r\n\r\n<br><br> &nbsp The \"Item Types\" allows you to create new types and choose a certain measurement for each such as kg, cm\r\n<br> &nbsp or whatever else you could possibly use. On the right side we also show all current types and give you the\r\n<br> &nbsp ability to edit them if needed.\r\n\r\n<br><br> &nbsp In the \"Item Type Measurements\" you can create custom measurements but also review the current ones and\r\n<br> &nbsp modify them. \r\n\r\n<br><br> &nbsp The reason we do this is to keep a pure statistic over all of the information of the materials and not to\r\n<br>&nbsp confuse types etc.\r\n<br> &nbsp We also keep statistics of all of the stock of each material, that is the reason why we suggest the creation of a\r\n<br> &nbsp private supplier named \"Vaizdine Reklama\" with which you can add any stock you wish which you procured by\r\n<br> &nbsp yourself and not through any supplier, this way the statistics would not be tempered with and you could still\r\n<br> &nbsp add materials even though you did not receive the stock from any supplier but bought it yourself.\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Countries" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:372px;\">\r\n<h1>\r\nCOUNTRIES\r\n</h1>\r\n <p>\r\n&nbsp The menu for countries features two tabs, one for all of the countries which contains a list of the countries\r\n<br>&nbsp with which there are being transactions, their Tld and their flags. The other tab \"New Country\" allows you add\r\n<br>&nbsp new countries in the system. The Country tld textfield has to be inputed properly so that the flag appears in\r\n<br>&nbsp the \"All Countries\" list. However, all information of any country can be edited by selecting the country and then \r\n<br>&nbsp pressing on \"Edit Country\" From the \"All Countries\".\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Cities" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:370px;\">\r\n<h1>\r\nCITIES\r\n</h1>\r\n <p>\r\n&nbsp The menu for cities features two tabs, one for all of the cities which contains a list of the cities\r\n<br>&nbsp with which there are being transactions, the countries they are from and their flags. The other tab \"New City\"\r\n<br>&nbsp allows you to add new cities in the system. The Country selection allows you to select one of the countries\r\n<br>&nbsp added in the system from the \"Country\" menu.\r\n<br>&nbsp All the information for every city can be easily edited by pressing \"Edit City\" in the \"All Cities\" tab.\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Employees" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:228px;\">\r\n<h1>\r\nEMPLOYEES\r\n</h1>\r\n <p>\r\n&nbsp The menu for employees is designed as a place to keep track of the current employees. We created it to keep\r\n<br>&nbsp track of four aspects of work :\r\n<ul>\r\n<li>\r\nAccountant\r\n</li>\r\n<li>\r\nCEO\r\n</li>\r\n<li>\r\nManager\r\n</li>\r\n<li>\r\nWorker\r\n</li>\r\n</ul>\r\n<br>&nbsp This way you have a general idea of all employees responsabilities.\r\n<br>&nbsp The addition of jobs allows us to keep make two kind of searches when looking for \r\n<br>&nbsp employees in \"All Employees\" tab, one of them is the job search which can be all or one in particular, the other\r\n<br>&nbsp one is the selection of the base information like any other general search. Just like with the other menus, you\r\n<br>&nbsp can edit all of the information and also change the status of the employees as active or unactive, this showing\r\n<br>&nbsp if the employee is a current one or a previous employee. The \"New Employee\" tab allows you to add a new\r\n<br>&nbsp employee in the database, it requires a username and a password with which the employee can log in to the\r\n<br>&nbsp administration system to do the needed tasks.\r\n<br>&nbsp You may also choose if the employee you create is an active one, or one which will start work from some other\r\n<br>&nbsp time etc. \r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Customers" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:247px;\">\r\n<h1>\r\nCUSTOMERS\r\n</h1>\r\n <p>\r\n&nbsp The menu for customers is designed as a place to keep track of the current customers We created it to keep\r\n<br>&nbsp track of the following information:\r\n<ul>\r\n<li>\r\nLocation\r\n</li>\r\n<li>\r\nStatus\r\n</li>\r\n<li>\r\nName\r\n</li>\r\n<li>\r\nPhone number\r\n</li>\r\n<li>\r\nEmail\r\n</li>\r\n</ul>\r\n<br>&nbsp The \"All Customers\" tab allows you to see all of your customers, current or unactive, you can use this list to \r\n<br>&nbsp keep track of them and to also edit any information which may change, such as phone number, email etc with \r\n<br>&nbsp the \"Edit Customer\" button. The \"Change Status\" button allows you to set customers from active to unactive \r\n<br>&nbsp and vice versa. All the customers created in the system and held in the list can then log in with the username \r\n<br>&nbsp and password received in the customer system.In the \"New Customer\" tab you can create a new customer. \r\n<br>\r\n<br>&nbsp Be careful when creating the account, as the password will have to be used by them to log in to the system.\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Suppliers" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:280px;\">\r\n<h1>\r\nSUPPLIERS\r\n</h1>\r\n <p>\r\n&nbsp The menu for suppliers is designed as a place to keep track of the current suppliers. We created it to keep\r\n<br>&nbsp track of the following information:\r\n<ul>\r\n<li>\r\nLocation\r\n</li>\r\n<li>\r\nStatus\r\n</li>\r\n<li>\r\nName\r\n</li>\r\n<li>\r\nPhone number\r\n</li>\r\n<li>\r\nEmail\r\n</li>\r\n</ul>\r\n<br>&nbsp The \"All Suppliers\" tab allows you to see all of your suppliers, current or unactive, you can use this list to \r\n<br>&nbsp keep track of them and to also edit any information which may change, such as phone number, email etc with \r\n<br>&nbsp the \"Edit Supplier\" button. The \"Change Status\" button allows you to set suppliers from active to unactive.\r\n<br>&nbsp In the \"New Supplier\" tab you can create a new supplier.\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "SubContractor" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:217px;\">\r\n<h1>\r\nSUBCONTRACTORS\r\n</h1>\r\n <p>\r\n&nbsp The menu for subcontractors is designed as a place to keep track of the current subcontractors. We created it to keep\r\n<br>&nbsp track of the following information:\r\n<ul>\r\n<li>\r\nLocation\r\n</li>\r\n<li>\r\nStatus\r\n</li>\r\n<li>\r\nName\r\n</li>\r\n<li>\r\nPhone number\r\n</li>\r\n<li>\r\nEmail\r\n</li>\r\n<li>\r\nJob\r\n</li>\r\n</ul>\r\n<br>&nbsp The \"All SubContractors\" tab allows you to see all of your subContractors, current or unactive, you can use this list to \r\n<br>&nbsp keep track of them and to also edit any information which may change, such as phone number, email etc with \r\n<br>&nbsp the \"Edit SubContractor\" button. The \"Change Status\" button allows you to set subContractors from active to unactive.\r\n<br>&nbsp In the \"New SubContractor\" tab you can create a new supplier. There you can choose which jobs they handle which in return is created in the \"SubContractor Jobs\" tab. There you can keep track of the jobs and how many of them are active and the amount of subContractors on each job.\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
						case "Statistics" :
							helpLabel.setText("<html>\r\n<body style = \" margin-bottom:55px;\">\r\n<h1>\r\nSTATISTICS\r\n</h1>\r\n <p>\r\n&nbsp The statistics menu is used to keep track of all of the information in the system in a friendly and useful manner. \r\n<br>&nbsp It holds all useful information and can be a very useful tool in finding out which of the transactions are \r\n<br>&nbsp profitable or not.\r\n<br><br>\r\n&nbsp You can see information about the following things:\r\n<ul>\r\n<li>\r\nCustomers\r\n</li>\r\n<li>\r\nProjects\r\n</li>\r\n<li>\r\nSuppliers\r\n</li>\r\n<li>\r\nCountries with suppliers\r\n</li>\r\n<li>\r\nSubContractors\r\n</li>\r\n<li>\r\nCountries with SubContractors\r\n</li>\r\n<li>\r\nRequests\r\n</li>\r\n<li>\r\nOffers\r\n</li>\r\n</ul>\r\n\r\n<br>&nbsp In the \"Customers\" tab you can see all of the customers present in the system, you can search them based on \r\n<br>&nbsp different filters, such as a certain period or a location.\r\nYou can see where they are from, how many projects \r\n<br>&nbsp they have, how much they pay for it and how much the company pays from the material costs to make the \r\n<br>&nbsp project, we then show the Revenue left from that.\r\nYou can also see the amount of requests from that \r\n<br>&nbsp customer and how many offers they have received.\r\n<br>\r\n<br>&nbsp In the \"Projects\" tab you can see all of the projects in the system based on certain filters, just like in the \r\n<br>&nbsp customers tab, you can see projects based on a set period, location, or just in general. You can see their\r\n<br>&nbsp names, the cost, the price, the revenue gained by subtracting the cost from the price, \r\n<br>&nbsp the customer who wants it and the deadline.\r\n<br>\r\n<br>&nbsp The \"Suppliers\" tab holds information on all suppliers, it presents them based on location or all of them, the \r\n<br>&nbsp information is wehter they are active or not, their names and the amount of materials they have supplied.\r\n<br>\r\n<br>&nbsp The \"Supplier Countries\" shows all of the active countries which have suppliers and all of the materials which \r\n<br>&nbsp have been received from each country.\r\n<br>\r\n<br>&nbsp In the \"SubContractors\" tab, you can see all of the subContractors in the system, how much they have been \r\n<br>&nbsp paid in total and on how many projects they have worked on. You can filter that information based on location.\r\n</p>\r\n</body>\r\n</html>");
							
							break;
							
					}
				}
		}
	}

